<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Rep\DispatchOrderRep;
use Illuminate\Http\Request;

class DispatchOrder extends Controller
{
    //派单顺序列表
    protected $rep;

    public function __construct(Request $request)
    {
        $this->rep = new DispatchOrderRep();
    }

    /**
     * 获取派单顺序列表
     * @param Request $request
     */
    public function getDispatchOrderList(Request $request){
        $params = $request->all();
        $data = $this->rep->getDispatchOrderListRep($params);
        return re(0,$data,'success');
    }


    /**
     * 设置顺序
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function setDispatchOrder(Request $request){
        $params = $request->all();
        $data = $this->rep->setDispatchOrderRep($params);
        return re($data['code'],$data['data'],$data['msg']);
    }
}
